<template>
	<view class="page">
		<u-sticky>
			<u-tabs :list="tabbar" :is-scroll="false" :current="current" @change="change"></u-tabs>
		</u-sticky>
	    
		
		
		<view>
			<book :list="list" v-if="list.length" @go="go">
				<template  #top="{orderType,status,top}">
					<view style="color: #FF5D39;margin-bottom: 20rpx;font-weight: bold;">
					<!-- 	<text>{{orderType==5 && top ==2?'加急':orderType==5 && top ==0?'免费':orderType==5 && top ==1?'插队':orderType==3?'插队':''}}设计</text> -->
					<text>{{top==0?'免费':top==1?'插队':top==2?'加急':''}}设计	</text>
						<text>{{status==6?'已完成':'-待处理'}}</text>
					</view>
					
				</template>
			</book>
		</view>
		
		
		<u-loadmore :status="initial.status" />
	</view>
</template>

<script>
	import loader from '@/common/loadPage.js';
	import book from './components/book.vue';
	
	
	
	export default {
		mixins: [loader],
		components:{
			book
		},
		data() {

			return {
				banShare:true,
				tabbar: [
			     {
					name: '待处理',
					state:"3,4"
					} ,{
					name: '已完成',
					state:6
				}],
				current: 0,
				list: [],
				initial: {
					geturl: "/indent/orderList",
					parm: {
					 order_type:5,
					 state:"4,3"
					},
					isPage: true
				},




			}
		},
		async onLoad(options) {
			this.getGoods()
		},
		methods: {
			change(e){
				this.current=e;
				this.initial.page=1;
				this.initial.parm.state =this.tabbar[e].state;
				this.getGoods()
			},
			go(e){
				uni.navigateTo({
					url:"./free_detail?id="+e.id
				})
			},
			orderType(e){
			    let txt=e==8?'家装':e==9?'工装':e==10?'园林':'';
				console.log(e, txt)
			    return txt
			}
			
		}
	}
</script>


<style>
	
	.list{
		background: #fff;
	    width:700rpx;
		 margin: 20rpx auto;
		 padding: 20rpx;
	}
</style>
